home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / TURBOPASCAL WIN / RWDOC.PAK / MANUAL.RW < prev    next >
Encoding:
Text File  |  1992-06-08  |  55.3 KB  |  1,624 lines

  1.                             MANUAL.RW
  2.                             =========
  3.  
  4.  
  5. This file contains additions and corrections to the Resource
  6. Workshop User's Guide, including support of Windows 3.1 and
  7. Borland Windows Custom Controls (BWCC).
  8.  
  9. The Resource Workshop online documentation also includes these
  10. files:
  11.  
  12. BWCCAPI.RW    Describes technical aspects of Borland Windows
  13.               Custom Controls.
  14.  
  15. CUSTCNTL.RW   Describes creating Windows custom controls classes,
  16.               with C and Pascal programming examples.
  17.  
  18. BWCCSTYL.RW   Describes general style guidelines for creating
  19.               resources using BWCC.
  20.  
  21. Contents (lists only section and first subsection headings)
  22. -----------------------------------------------------------
  23.  
  24.     1  Changes to the Resource Workshop User's Guide
  25.          1.1     Introduction
  26.          1.2     Chapter 2, Resource Workshop Basics
  27.          1.3     Chapter 3, Working with projects and resources
  28.          1.4     Chapter 4, Creating dialog boxes
  29.          1.5     Chapter 5, Creating menus
  30.          1.6     Chapter 6, Creating accelerators
  31.          1.7     Chapter 8, Using the Paint editor
  32.          1.8     Chapter 9, Creating icons
  33.          1.9     Chapter 10, Creating cursors
  34.          1.10    Chapter 11, Creating fonts
  35.          1.11    Appendix A, Technical notes
  36.     2  Changes for this release
  37.          2.1     Visible option
  38.          2.2     Windows version compatibility
  39.          2.3     Dialog box positioning
  40.     3  New features in Windows 3.1
  41.          3.1     Style dialog boxes
  42.          3.2     Icon sizes
  43.          3.3     Version stamper
  44.     4  Linker requirements
  45.          4.1     BWCC.LIB
  46.          4.2     BWCC.DLL
  47.          4.3     BWCC and Object Windows Library (OWL)
  48.     5  Borland Windows Custom Controls
  49.          5.1     Using the custom dialog class
  50.          5.2     Using the custom controls
  51.          5.3     Customizing existing applications for BWCC
  52.     6  Loading BWCC to enable Borland custom controls
  53.     7  Sample exercise: Customizing an existing application
  54.          7.1     Backing up the application
  55.          7.2     Opening a project
  56.          7.3     Editing the application's controls
  57.          7.4     Saving and testing the project
  58.     8  Tips on editing resources
  59.          8.1     Accelerators
  60.          8.2     Bitmaps
  61.          8.3     Cursors
  62.          8.4     Dialog boxes
  63.          8.5     Icons
  64.          8.6     Menus
  65.          8.7     String tables
  66.  
  67.  
  68. 1        Changes to the Resource Workshop User's Guide
  69. ------------------------------------------------------
  70.  
  71. The following sections describe corrections to the Resource
  72. Workshop User's Guide or changes to existing functionality.
  73.  
  74.  
  75. 1.1      Introduction
  76. ---------------------
  77.  
  78. p. 5     The following is current information for "How to contact
  79. Borland":
  80.  
  81.     Phone/Command       Service
  82.     -------------------------------------------------------------
  83.     408-461-9144        Borland Pascal Technical Support, 6 a.m. 
  84.                            to 5 p.m. PST
  85.     800-822-4269        TechFax, 24-hour technical information to
  86.                            fax machines (touch-tone phones only)
  87.     408-439-9096        Borland File Download BBS (2400 baud)
  88.     GO BORLAND          CompuServe
  89.     JOIN BORLAND        BIX
  90.     BORLAND             GEnie
  91.  
  92.  
  93. 1.2      Chapter 2, Resource Workshop basics
  94. --------------------------------------------
  95.  
  96. p. 17    If you have a Pascal compiler, the demo file is called
  97. RWPDEMO. If you have a C++ compiler, the demo file is RWCDEMO.
  98.  
  99. p. 25    If you have a Pascal compiler, put your identifiers in a
  100. .PAS constant file.
  101.  
  102.  
  103. 1.3      Chapter 3, Working with projects and resources
  104. -------------------------------------------------------
  105.  
  106. p. 33, step 2, last paragraph: The Resource|New and File|Add to
  107. Project commands are not available for the .CUR, .ICO, .BMP, and
  108. .FNT resource types.
  109.  
  110.  
  111. 1.4      Chapter 4, Creating dialog boxes
  112. -----------------------------------------
  113.  
  114. p. 64    Change the first bullet in the bulleted list at the
  115. bottom of the page to the following:
  116.  
  117.     - Resize the dialog box in either of the following ways:
  118.  
  119.          - Drag the appropriate edge or corner.
  120.  
  121.          - Select the dialog box by clicking the dialog box's
  122.            title bar, and then choose Align|Size to display the
  123.            Size Dialog dialog box. Enter width (CX) and height
  124.            (CY) values in dialog units.  The size values apply to
  125.            the outer dimensions of the dialog box.
  126.  
  127. p. 70    The following paragraph applies to Figure 4.6:
  128.  
  129.     If you install a custom control library containing custom
  130.     controls whose Class is recognized by Resource Workshop, the
  131.     Tools palette can have more than four columns. Bitmaps for
  132.     these custom controls are added to the right side of the
  133.     Tools palette. (See page 99 and the file CUSTCNTL.RW on the
  134.     installation disk for more information on custom controls.)
  135.  
  136. p. 82    In the section "Aligning multiple controls," the command
  137. is Align|Align, not Align|Align Controls.
  138.  
  139. p. 90    The following text accurately describes the scroll bar
  140. alignment options:
  141.  
  142. None          The scroll bar fills the entire selection frame
  143.               (default). If you resize the selection frame, you
  144.               can distort the scroll bar.
  145.  
  146. Top Left      A horizontal scroll bar displays undistorted at the
  147.               top of the selection frame and extends the full
  148.               width of the frame. A vertical scroll bar displays
  149.               undistorted at the left side of the selection frame
  150.               and extends the full height of the frame.
  151.  
  152. Bottom Right  A horizontal scroll bar displays undistorted at the
  153.               bottom of the selection frame and extends the full
  154.               width of the frame. A vertical scroll bar displays
  155.               undistorted at the right side of the selection
  156.               frame and extends the full height of the frame.
  157.  
  158. p. 100   Add the following paragraphs to the first sentence after
  159. "Adding a custom control":
  160.  
  161.     If you've added a custom control library whose Class is
  162.     recognized by Resource Workshop and which has its own custom
  163.     bitmaps, you can select your controls directly from the
  164.     custom bitmaps on the right side of the Tools palette.
  165.  
  166.     If Resource Workshop doesn't recognize the Class of your
  167.     custom controls, you must do the following to add them to
  168.     your dialog boxes:
  169.  
  170. p. 103   In step 5, just above the figure, the last sentence of
  171. the second paragraph should read:
  172.  
  173.     If you can't see it, select the Project window and then
  174.     choose View|By File.
  175.  
  176. p. 106   The description of the Draft Drawing Type option in
  177. Table 4.27 should read as follows:
  178.  
  179.     Draws each control as a rectangle with its control_ID in the
  180.     center. This option also allows you to see the exact size of
  181.     each control rectangle.
  182.  
  183. The following is the correct description of the Selection options
  184. (Table 4.28):
  185.  
  186. Select Near Border      This option applies to clicking to select
  187.                         controls.
  188.                         On: You must click on the control's
  189.                         border.
  190.                         Off: You can click anywhere inside the
  191.                         control's border.
  192.  
  193. Selection Rectangle     This option applies to dragging a
  194. Surrounds               selection frame to select controls.
  195.                         On: You must entirely surround the
  196.                         control (or controls) with the selection
  197.                         rectangle.
  198.                         Off: The selection rectangle need only
  199.                         touch the control (or controls).
  200.  
  201.  
  202. 1.5           Chapter 5, Creating menus
  203. ---------------------------------------
  204.  
  205. p. 119, Table 5.1: Use the EnableMenuItem function to change the
  206. state of Enabled, Disabled, and Grayed menu items. Use the
  207. CheckMenuItem function to change the state of Checked menu items.
  208.  
  209. p. 125   In the text below the figure, "Arrange List..." should
  210. be "A&rrange List".
  211.  
  212. p. 126, Fig. 5.9: The illustration shows the menu before the new
  213. items are inserted, not after. The figure will be corrected in
  214. the next printing of the manual.
  215.  
  216. p. 136   The C header file (WDGCONST.H) would look like this:
  217.  
  218.     #define WMNU_LST 101
  219.     #define WMNU_ADD 102
  220.     #define WMNU_ASC 103
  221.     #define WMNU_DESC 104
  222.  
  223. In addition, the #include for the C version of the file would be
  224.  
  225.     #include "wdgconst.h"
  226.  
  227. p. 137   In the last paragraph of step 4, the text should say:
  228.  
  229.     ...indicating that you can press Alt-W to display the Widgets
  230.     menu.
  231.  
  232.  
  233. 1.6      Chapter 6, Creating acclereators
  234. -----------------------------------------
  235.  
  236. p. 140   The figure shows incorrect identifiers for the first
  237. four accelerators. The correct identifiers are, in order,
  238. cm_Undo, cm_Cut, cm_Copy, and cm_Paste.
  239.  
  240.  
  241. p. 153, step 6. The correct message text is "No duplicate key
  242. values found".
  243.  
  244.  
  245. 1.7      Chapter 8, Using the Paint editor
  246. ------------------------------------------
  247.  
  248. p. 181, Table 8.1. The mouse actions for Zoom In and Zoom Out are
  249. reversed. To zoom in, double-click on the Zoom icon; to zoom out,
  250. Shift+double-click on the Zoom icon.
  251.  
  252. p. 188   The correct text for the second bullet is
  253.  
  254.     ...then choose Edit Foreground Color or Edit Background Color
  255.     from the Icon or Bitmap menu, depending on which type of
  256.     resource you're editing.
  257.  
  258. p. 189   In two places on this page, the text says "palette"
  259. where it should say "device." In the section "Editing a color,"
  260. the text in parentheses in the first paragraph should read
  261.  
  262.     (for a 16-color device, you might see a dithered color appear
  263.     in this box)
  264.  
  265. The marginal notation at the bottom of the page refers to a
  266. 256-color palette. The Granted color matches the Requested color
  267. on 256-color (or higher) devices, not palettes.
  268.  
  269. p. 190   The System button is enabled for devices that support
  270. 256 colors or more.
  271.  
  272.  
  273. 1.8      Chapter 9, Creating icons
  274. ----------------------------------
  275.  
  276. p. 202, Fig. 9.4 and surrounding text: The dialog box is called
  277. New File Resource.
  278.  
  279.  
  280. 1.9      Chapter 10, Creating cursors
  281. -------------------------------------
  282.  
  283. p. 224, Fig. 10.4 and surrounding text: The dialog box is called
  284. New File Resource.
  285.  
  286.  
  287. 1.10     Chapter 12, Creating fonts
  288. -----------------------------------
  289.  
  290. p. 243   The following paragraph should appear after Step 1 of
  291. "Creating a new font resource":
  292.  
  293.     If you create a new project, you can choose the .RC, .RES, or
  294.     .FNT format. If you choose .RES or .FNT, Resource Workshop
  295.     automatically starts the Paint editor. The Source/Binary
  296.     dialog box is not displayed.
  297.  
  298. In Step 2, the option you choose is called FONT, not .FNT. In
  299. addition, the following might further clarify the Source and
  300. Binary options:
  301.  
  302.     The Source option "embeds" the font resource in the current
  303.     project; the font does not exist as a separate file and
  304.     cannot be used in any other project. The Binary option saves
  305.     the font resource as a separate file (with the .FNT
  306.     extension) that is linked to the current project. You can
  307.     link an .FNT file to other projects using the File|Add to
  308.     Project command.
  309.  
  310. p. 244   The Paint editor tools appear on the right side of the
  311. screen. (A similar error occurs on p. 255.)
  312.  
  313. p. 246   The following might further clarify the explanation of
  314. the Stretch Current Chars option:
  315.  
  316.     When this option is checked, any changes you make to the
  317.     width or height values in this dialog box will cause the
  318.     width or height of existing characters to change accordingly.
  319.  
  320. p. 252   In Step 4 at the top of the page, the command is
  321. File|Save Project or File|Save File As. File|Save Project
  322. overwrites the current project; File|Save File As creates a new
  323. project file, allowing you to keep your old version.
  324.  
  325. In the section "Saving the project," the command is File|Save
  326. Project.
  327.  
  328. In the section "Saving a font resource as a file," the command is
  329. Resource|Save Resource As, and the dialog box is called Save
  330. Resource As. The first sentence in the section should read as
  331. follows:
  332.  
  333.     Saving the entire project saves all resources in the project,
  334.     not just the font resource you're working on.
  335.  
  336. p. 256   In Step 3, the two page references are inaccurate. In
  337. the second paragraph, the correct page reference for the maximum
  338. width value is to page 246. In the third paragraph, the correct
  339. page reference for the break character is to page 247.
  340.  
  341.  
  342. 1.11     Appendix A, Technical notes
  343. ------------------------------------
  344.  
  345. p. 266   The preprocessor incompatibility between the Microsoft
  346. Resource Compiler and the Resource Workshop compiler in handling
  347. complex parameterized #defines no longer exists.
  348.  
  349. However, the Microsoft Resource Compiler and Resource Workshop
  350. are still incompatible in several areas:
  351.  
  352. - interpretation of numbers with leading zeros
  353.  
  354. - the #undef preprocessor directive
  355.  
  356. - preprocessor token pasting
  357.  
  358. - expressions in resources IDs and resource type IDs
  359.  
  360. - hexadecimal numbers in resources IDs and resource type IDs
  361.  
  362. - complex constant expressions
  363.  
  364. - duplicate resource IDs
  365.  
  366. - resource IDs greater than 32767
  367.  
  368. - floating END statements
  369.  
  370. - floating operators in expressions
  371.  
  372. - missing operators in expressions
  373.  
  374. - parsing of the CAPTION statement
  375.  
  376. - macros in include directives
  377.  
  378. - valid characters in resource names
  379.  
  380.  
  381. 1.11.1   Numbers with leading zeros
  382. -----------------------------------
  383.  
  384. Because of inconsistencies in the Microsoft Resource Compiler's
  385. treatment of numbers with leading zeros, don't use them in
  386. preprocessor expressions or identifiers. The Resource Workshop
  387. compiler is consistent in interpreting as an octal number any
  388. numeric constant preceded by a zero that's used as part of an
  389. identifier or a preprocessor expression. However, the Microsoft
  390. Resource Compiler interprets numbers with leading zeros in
  391. preprocessor expressions as octal numbers, but interprets the
  392. same numbers in identifiers as decimal numbers.
  393.  
  394. For example, the Microsoft Resource Compiler would interpret the
  395. expression 010+1 as a 9 in the following preprocessor expression,
  396. but as an 11 in the string table identifier.
  397.  
  398.     #if (9 == 010+1)
  399.        STRINGTABLE
  400.        BEGIN
  401.            010+1, "Bug"
  402.        END
  403.     #endif
  404.  
  405.  
  406. 1.11.2   The #undef preprocessor directive
  407. ------------------------------------------
  408.  
  409. Resource Workshop has limited support for the #undef preprocessor
  410. directive. You can use it only with #defines that are not
  411. referenced by a resource. If you use #undef with a #define that's
  412. been referenced, you get a fatal compiler error when compiling
  413. the .RC file under Resource Workshop.
  414.  
  415. This restriction does not apply to the command-line resource
  416. compiler.
  417.  
  418.  
  419. 1.11.3   Token pasting
  420. ----------------------
  421.  
  422. Resource Workshop does not support token pasting in preprocessor
  423. statements. See the "Borland C++ Programmer's Guide" for more
  424. information on token pasting.
  425.  
  426.  
  427. 1.11.4   Hexadecimal numbers in
  428.          resource IDs and resource type IDs
  429. -------------------------------------------
  430.  
  431. Resource Workshop supports hexadecimal numbers in resource IDs;
  432. the Microsoft Resource Compiler does not. For example, the
  433. following statement compiles correctly using Resource Workshop,
  434. but fails using the Microsoft Resource Compiler:
  435.  
  436.     0x0001  ICON file.ico
  437.  
  438. The Microsoft Resource Compiler emits an icon resource with the
  439. name "0x0001". Resource Workshop emits an icon resource with an
  440. ID equal to 1.
  441.  
  442.  
  443. 1.11.5   Expressions in resource IDs and resource type IDs
  444. ----------------------------------------------------------
  445.  
  446. Resource Workshop supports expressions in resource IDs; the
  447. Microsoft Resource Compiler does not. For example, the following
  448. statement compiles correctly using Resource Workshop, but fails
  449. using the Microsoft Resource Compiler:
  450.  
  451.     101 + 1000 BITMAP vga.bmp
  452.  
  453. The Microsoft Resource Compiler parses "101" as a resource ID,
  454. "+" as a resource type name, "1000" as a file name, and then
  455. fails. Resource Workshop correctly emits a bitmap resource with
  456. an ID equal to 1101.
  457.  
  458.  
  459. 1.11.6   Complex constant expressions
  460. -------------------------------------
  461.  
  462. Resource Workshop supports full C-language constant expressions
  463. in place of a simple number anywhere in a resource script where a
  464. number is allowed. The Microsoft Resource Compiler supports only
  465. simple expressions. For example, the following expression is
  466. correctly evaluated by Resource Workshop, but fails using the
  467. Microsoft Resource Compiler:
  468.  
  469.     3 * (1 + 2) - 1
  470.  
  471. The most common example of this incompatibility is often seen in
  472. ICON statements in DIALOG templates. The following statement
  473. causes an error in Resource Workshop, but not in the Microsoft
  474. Resource Compiler:
  475.  
  476.     ICON   3 -1, 10, 10, 0, 0
  477.  
  478. Resource Workshop interprets "3 -1" as an expression that
  479. evaluates to 2. The Microsoft Resource compiler interprets "3 -1"
  480. as two separate fields. If you add a comma after the first
  481. number, both compilers interpret the statement correctly:
  482.  
  483.     ICON   3, -1, 10, 10, 0, 0
  484.  
  485. 1.11.7   Duplicate resource IDs
  486. -------------------------------
  487.  
  488. To allow resources to be accessed at run time, Resource Workshop
  489. enforces the rule that resource IDs or names must be unique
  490. within each resource type; the Microsoft Resource Compiler does
  491. not. The following statements causes Resource Workshop to display
  492. an error:
  493.  
  494.     1 ICON file1.ico
  495.     1 ICON file2.ico
  496.  
  497.  
  498. 1.11.8   Resource IDs greater than 32767
  499. ----------------------------------------
  500.  
  501. Although the Microsoft documentation states that resource IDs can
  502. be any number between 1 and 65535, you must actually use resource
  503. IDs that fall between 1 and 32767 to ensure that the IDs are
  504. unique. The reason is that resource binders like RLINK or the
  505. Microsoft Resource Compiler OR all resource IDs with 0x8000 when
  506. they build the resource directory in the executable file,
  507. producing a value from 32768 to 65535.
  508.  
  509.  
  510. 1.11.9   Floating END statements
  511. --------------------------------
  512.  
  513. Resource Workshop does not allow END statements with no
  514. corresponding BEGIN. The Microsoft Resource Compiler allows these
  515. statements. For example, the following script fragment causes an
  516. error in Resource Workshop:
  517.  
  518.     1 RCDATA
  519.     BEGIN
  520.       0
  521.     END
  522.  
  523.     END
  524.  
  525.  
  526. 1.11.10  Floating operators in expressions
  527. ------------------------------------------
  528.  
  529. Resource Workshop's expression parser does not allow "floating"
  530. operators in constant expressions; the Microsoft Resource
  531. Compiler does. For example, the following expression is flagged
  532. as an error in Resource Workshop:
  533.  
  534.     WS_SYSMENU | WS_CAPTION |
  535.  
  536. To correct the error, merely remove the last bitwise OR operator:
  537.  
  538.     WS_SYSMENU | WS_CAPTION
  539.  
  540.  
  541. 1.11.11  Missing operators in expressions
  542. -----------------------------------------
  543.  
  544. Resource Workshop's expression parser requires that all operators
  545. required for an expression be present. The Microsoft Resource
  546. Compiler assumes that a missing operator is a bitwise OR
  547. operator. For example, the following expression is flagged as an
  548. error in Resource Workshop:
  549.  
  550.     WS_SYSMENU  WS_CAPTION
  551.  
  552. To correct the error, add the bitwise OR operator:
  553.  
  554.     WS_SYSMENU | WS_CAPTION
  555.  
  556.  
  557. 1.11.12  Parsing of the CAPTION statement
  558. -----------------------------------------
  559.  
  560. The Microsoft Resource Compiler is order-dependent in the way it
  561. handles the CAPTION statement in a DIALOG template; the Resource
  562. Workshop compiler is not. The following fragments illustrate this
  563. difference:
  564.  
  565.     1 DIALOG 10, 10, 100, 100
  566.     CAPTION "Caption"
  567.     BEGIN
  568.     END
  569.  
  570.     2 DIALOG 10, 10, 100, 100
  571.     STYLE WS_POPUP
  572.     CAPTION "Caption"
  573.     BEGIN
  574.     END
  575.  
  576.     3 DIALOG 10, 10, 100, 100
  577.     CAPTION "Caption"
  578.     STYLE WS_POPUP
  579.     BEGIN
  580.     END
  581.  
  582. In the first example, there is no explicit STYLE statement, and
  583. both compilers default to WS_POPUP | WS_BORDER | WS_SYSMENU,
  584. which is OR'd with WS_CAPTION. The style of the resulting DIALOG
  585. template is
  586.  
  587.     WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION
  588.  
  589. In the second example, the STYLE statement precedes the CAPTION
  590. statement, and both compilers OR the two together. The style of
  591. the resulting DIALOG template is
  592.  
  593.     WS_POPUP | WS_CAPTION
  594.  
  595. In the third example, the CAPTION statement precedes the STYLE
  596. statement.
  597.  
  598. The Microsoft Resource Compiler, having encountered an explicit
  599. STYLE statement, clears any preceding implicit or preset styles.
  600. The resulting DIALOG template has the style
  601.  
  602.     WS_POPUP
  603.  
  604. By contrast, the Resource Workshop compiler ORs the CAPTION and
  605. STYLE statements to produce a DIALOG template with the style
  606.  
  607.     WS_CAPTION | WS_POPUP
  608.  
  609.  
  610. 1.11.13  Macros in include directives
  611. -------------------------------------
  612.  
  613. Resource Workshop does not support macro expansion in include
  614. directives. For example, the following fragment causes a compile
  615. error:
  616.  
  617.     #define MYFILE "afile.h"
  618.  
  619.     #include MYFILE
  620.  
  621.  
  622. 1.11.14  Support of the CTLDATA statement
  623. -----------------------------------------
  624.  
  625. Resource Workshop supports the CTLDATA statement for use with
  626. custom controls. The CTLDATA statement is described in the online
  627. file CUSTCNTL.RW. The Microsoft Resource Compiler does not
  628. support CTLDATA.
  629.  
  630.  
  631. 1.11.15  Valid characters in resource names
  632. -------------------------------------------
  633.  
  634. Resource Workshop follows standard C-language practice for valid
  635. characters in resource names. It accepts any alphanumeric
  636. characters in the ANSI character set (including accented
  637. non-English-language characters like "é"), plus the underscore.
  638. Nonalphanumeric characters like slash, backslash, or the plus
  639. sign are not valid. The resource name must start with a letter or
  640. the underscore; it cannot start with a number.
  641.  
  642. The Microsoft Resource Compiler does not restrict resource names
  643. to alphanumeric characters.
  644.  
  645.  
  646. 2        Changes for this release
  647. ---------------------------------
  648.  
  649. This section describes the changes made for this release of
  650. Resource Workshop.
  651.  
  652.  
  653. 2.1      Visible option
  654. -----------------------
  655.  
  656. The style dialog boxes for buttons, list boxes, group boxes,
  657. combo boxes, static controls, and text controls (including static
  658. text) have a check box option called Visible.
  659.  
  660. By default, this option is checked on (WS_VISIBLE), and the
  661. control appears when the dialog box is first displayed. If the
  662. option is turned off (NOT WS_VISIBLE), the control does not
  663. appear. In that case, the application can call the ShowWindow
  664. function at run time to display the hidden control.
  665.  
  666.  
  667. 2.2      Windows version compatibility
  668. --------------------------------------
  669.  
  670. You can specify the target Windows version in the
  671. File|Preferences dialog box.  Note that .RES and .EXE files
  672. targeted for Windows 3.1 are not backward-compatible with Windows
  673. 3.0.
  674.  
  675. If the .RES file is targeted to Windows 3.1, you cannot use the
  676. Windows 3.0 version of RC.EXE to bind your resources to the
  677. application. You must use Borland tools or version 3.1 of the
  678. Microsoft Resource Compiler.
  679.  
  680.  
  681. 2.3      Dialog box positioning
  682. -------------------------------
  683.  
  684. For dialog boxes that use the WS_OVERLAPPED style, Windows allows
  685. you to leave the positioning of a dialog box to Windows itself.
  686. The Size Dialog dialog box (Align|Size) has a radio button called
  687. Set by Windows, which appears in the Horizontal Size column when
  688. the selected control is a dialog box frame.
  689.  
  690. If you click Set by Windows, the X-position field is
  691. automatically blanked out. Resource Workshop puts a value of
  692. 0x8000 into the X field (although not displayed on the screen),
  693. which tells Windows that it has charge of positioning the dialog
  694. box.
  695.  
  696. This option is generally used for dialog box frames that are used
  697. as main windows.
  698.  
  699.  
  700. 3        New features in Windows 3.1
  701. ------------------------------------
  702.  
  703. The following sections describe changes to Resource Workshop that
  704. reflect new features in Windows 3.1.
  705.  
  706.  
  707. 3.1      Style dialog boxes
  708. ---------------------------
  709.  
  710. The following check box options implemented in Windows 3.1 have
  711. been added to three of the style dialog boxes.
  712.  
  713. List Box Style
  714.  
  715.     Scroll bar always   The list box always displays a vertical
  716.                         scroll bar, regardless of the number of
  717.                         items it contains. The WINDOWS.H constant
  718.                         for this style is LBS_DISABLENOSCROL.
  719.  
  720. Combo Box Style
  721.  
  722.     Vertical scroll     The combo box always displays a vertical
  723.     always              scroll bar, regardless of the number of
  724.                         items it contains. The WINDOWS.H constant
  725.                         for this style is CBS_DISABLENOSCROL.
  726.  
  727. Edit Text Style
  728.  
  729.     Read only           The text is set to read-only. The
  730.                         WINDOWS.H constant for this style is
  731.                         ES_READONLY.
  732.  
  733.     Want return         A multiline edit text control accepts a
  734.                         carriage return to force a line break.
  735.                         The carriage return goes to the
  736.                         Defpushbutton if keyboard focus is NOT in
  737.                         the edit text control. The WINDOWS.H
  738.                         constant for this style is ES_WANTRETURN.
  739.  
  740.  
  741. 3.2      Icon sizes
  742. -------------------
  743.  
  744. Windows 3.1 supports icons in three sizes: 32x32 and 32x16 (also
  745. supported in Windows 3.0), plus 64x64.  The New Icon Image dialog
  746. box, illustrated in Figures 3.14 and 9.5 in the Resource Workshop
  747. User's Guide, now includes the new 64x64 option.  In reading
  748. Chapter 9, "Creating Icons," keep in mind that this new image
  749. size is now supported.
  750.  
  751.  
  752. 3.3      Version stamper
  753. ------------------------
  754.  
  755. Resource Workshop now supports VERSIONINFO, the version stamper
  756. for Windows 3.1 .EXE files. For a detailed description of
  757. VERSIONINFO, see the Resource Workshop online Help file.
  758.  
  759.  
  760. 4        Linker requirements
  761. ----------------------------
  762.  
  763. The following sections describe some special requirements for
  764. linking. See also section 9 for a description of Resource
  765. Workshop's command-line linker and compilers.
  766.  
  767.  
  768. 4.1      BWCC.LIB
  769. -----------------
  770.  
  771. You must link your program first with the import library BWCC.LIB
  772. and then with IMPORT.LIB, both of which are contained in the LIB
  773. subdirectory specified by the Install program. The order in which
  774. you use these two library files is critical: BWCC.LIB must
  775. precede IMPORT.LIB.
  776.  
  777.  
  778. 4.2      BWCC.DLL
  779. -----------------
  780.  
  781. Make the dynamic link library BWCC.DLL available for your
  782. application to use at run time by locating it in one of the
  783. following places:
  784.  
  785. - the same directory as your application's .EXE file
  786.  
  787. - the Windows startup or system directory
  788.  
  789. - a directory in your PATH
  790.  
  791.  
  792. 4.3      BWCC and Object Windows Library (OWL)
  793. ----------------------------------------------
  794.  
  795. If you use the DLL version of OWL, you must load BWCC.DLL
  796. explicitly.  To do so, insert the following code into WinMain
  797. before the code that invokes the Application Run method:
  798.  
  799.     HANDLE hDLL:
  800.       hDLL = LoadLibrary ("BWCC.DLL");
  801.  
  802. At the end of WinMain, insert this line of code:
  803.  
  804.     if (hDLL) FreeLibrary ("BWCC.DLL");
  805.  
  806.  
  807. 5        Borland Windows Custom Controls
  808. ----------------------------------------
  809.  
  810. The Borland Windows Custom Controls (BWCC) library contains a
  811. custom dialog class and a set of custom controls (buttons, check
  812. boxes, group shading boxes, and the like). BWCC adds to the
  813. visual impact of your dialog boxes and optimize their
  814. functionality.
  815.  
  816.  
  817. 5.1      Using the custom dialog class
  818. --------------------------------------
  819.  
  820. The custom dialog class, BORDLG, works on both a visual and a
  821. functional level.
  822.  
  823. - It improves the appearance of your dialog window by painting
  824.   the background with a brush that varies according to the target
  825.   display device. For screens of VGA and higher resolution, the
  826.   background is a fine grid of perpendicular white lines, giving
  827.   the effect of "chiseled steel." For EGA and monochrome screens,
  828.   the background is white.
  829.  
  830. - It optimizes the drawing of dialog boxes by calling the custom
  831.   control drawing routines directly, instead of waiting for
  832.   Windows to paint the controls. This eliminates the typical
  833.   sluggish drawing of dialog boxes.
  834.  
  835. To use the custom dialog class, enter "bordlg" as the Class in
  836. the Window Style dialog box.
  837.  
  838.  
  839. 5.2      Using the custom controls
  840. ----------------------------------
  841.  
  842. The custom controls give the dialog box visual impact, with
  843. several of them adding a three-dimensional effect. To the
  844. end-user, they function in the same manner as the standard
  845. Windows controls, although they include several technical
  846. enhancements (described later).
  847.  
  848. The following is a brief description of the custom controls.
  849. Detailed descriptions are given later in this file.
  850.  
  851. Group shade        A recessed, shaded rectangular box used to
  852.                    group other controls. It differs from the
  853.                    standard group box by giving an impression of
  854.                    depth.
  855.  
  856. Borland            A family of push buttons with several highly
  857. push button        visual bitmapped symbols, plus an owner-draw
  858.                    option. The BWCC push buttons are larger than
  859.                    most standard Windows push buttons.
  860.  
  861. Borland            A raised diamond-shaped radio button. When the
  862. radio button       button is clicked, a black diamond appears in
  863.                    its center, and the button shading reverses,
  864.                    giving the impression that the button has been
  865.                    pushed down. There is also an owner-draw
  866.                    option.
  867.  
  868. Borland            A raised check box that displays a check mark
  869. check box          instead of an "X." There is also an owner-draw
  870.                    option.
  871.  
  872. Bitmap             A bitmap that can display a splash panel, or a
  873.                    non-modifiable image that remains on the
  874.                    dialog box.
  875.  
  876. Horizontal/        Horizontal and vertical dividing lines that
  877. Vertical dip       give the impression of being etched into the
  878.                    surface of the dialog box. You can convert the
  879.                    dips to horizontal and vertical bumps, which
  880.                    appear to be raised above the surface of the
  881.                    dialog box.
  882.  
  883.  
  884. 5.2.1    Button and check box messages
  885. --------------------------------------
  886.  
  887. The BWCC push buttons, radio buttons, and check boxes have the
  888. following functional enhancements over the standard Windows
  889. controls:
  890.  
  891. - They include an additional level of parent window notification
  892.   and control over keyboard focus and tab movement. If you choose
  893.   the Parent Notify option in the control's style dialog box, the
  894.   control sends the following messages (as appropriate) at run
  895.   time:
  896.  
  897.   BBN_SETFOCUS          Indicates to the parent window that the
  898.                         push button, radio button, or check box
  899.                         has gained keyboard focus through an
  900.                         action other than a mouse click.
  901.  
  902.   BBN_SETFOCUSMOUSE     Indicates to the parent window that the
  903.                         push button, radio button, or check box
  904.                         has gained keyboard focus through a mouse
  905.                         click.
  906.  
  907.   BBN_GOTATAB           Indicates to the parent window that the
  908.                         user has pressed the Tab key while the
  909.                         push button, radio button, or check box
  910.                         has keyboard focus. The parent can
  911.                         intervene in the processing of the
  912.                         keystroke by returning a nonzero value.
  913.  
  914.   BBN_GOTABTAB          Indicates to the parent window that the
  915.                         user has pressed Shift-Tab (back-tab)
  916.                         while the push button, radio button, or
  917.                         check box has keyboard focus. The parent
  918.                         can intervene in the processing of the
  919.                         keystroke by returning a nonzero value.
  920.  
  921. - They include an owner-draw option so that the parent window can
  922.   draw the push button, radio button, or check box. The
  923.   owner-drawn control will look different from standard Windows
  924.   controls, but will have the standard behavior of that class of
  925.   control.
  926.  
  927.  
  928. 5.2.2    Using the BWCC style dialog boxes
  929. ------------------------------------------
  930.  
  931. There are four style dialog boxes for the BWCC controls:
  932.  
  933. - Borland Button Style
  934.  
  935. - Borland Radio Button Style
  936.  
  937. - Borland Check Box Style
  938.  
  939. - Borland Shade Style
  940.  
  941. Each has a control window for entering a Caption and a Control
  942. ID.  The button style and check box style dialog boxes have
  943. Attributes options for Tab Stop, Disabled, Group, and Border
  944. (described in the Resource Workshop User's Guide), as well as
  945. Visible, Parent Notify, and Owner Draw (described earlier in this
  946. file). The shade style dialog box's only Attribute option is
  947. Group.
  948.  
  949. The next four sections describe the features unique to each of
  950. the style dialog boxes.
  951.  
  952.  
  953. 5.2.2.1  Borland Button Style dialog box
  954. ----------------------------------------
  955.  
  956. This dialog box allows you to choose from the three button types:
  957. Pushbutton, Defpushbutton, and Bitmap.
  958.  
  959. By default, Pushbutton is the selected option. A Defpushbutton
  960. has a bold border to identify it to the end-user as the "default
  961. button," which is executed when the user presses the Enter key.
  962. (The one exception occurs when keyboard focus is in an Edit Text
  963. control for which the Want Return flag has been set. See Section
  964. 3.1 of this file.)
  965.  
  966. The following Control ID values and images are predefined for the
  967. BWCC button controls:
  968.  
  969.    ID  button      image
  970.   ---  ------      -----------------
  971.     1  OK          green check mark
  972.     2  Cancel      red X
  973.     3  Abort       panic button
  974.     4  Retry       slot machine
  975.     5  Ignore      55 mph speed-limit sign
  976.     6  Yes         green check mark
  977.     7  No          red circle-slash
  978.   998  Help        blue question mark
  979.     -  Button      generic "Button" text - uses next available
  980.                    Control ID
  981.  
  982. If you choose the Bitmap option, you can insert an image (based
  983. on its Control ID) into the button image. To read in a bitmap:
  984.  
  985. 1.  Use the Button control to add the generic BWCC button to your
  986.     dialog box. Note its Control ID.
  987.  
  988. 2.  Switch to the Paint editor and create a bitmap image. (See
  989.     page 234 for information about creating bitmaps.)
  990.  
  991. 3.  In the Paint editor, choose Resource|Rename.
  992.  
  993.     If you have a screen of VGA resolution or higher, add 1000 to
  994.     the Control ID, and enter this value into the New Name field.
  995.     For EGA or monochrome screens, add 2000 to the Control ID,
  996.     and enter this value into the New Name field. Choose OK.
  997.  
  998. 6.  Close the Paint editor and return to the Dialog editor. The
  999.     bitmap will then appear in the BWCC button.
  1000.  
  1001.  
  1002. 5.2.2.2  Borland Radio Button Style dialog box
  1003. ----------------------------------------------
  1004.  
  1005. This dialog box lists two button styles:
  1006.  
  1007. Auto radio button  BWCC and Windows combine to handle
  1008.                    highlighting the selected button and
  1009.                    deselecting the other buttons. This is the
  1010.                    default option.
  1011.  
  1012. Radio button       The application must call the CheckDlgButton
  1013.                    function to send a BM_SETCHECK message to
  1014.                    highlight the selected button and deselect the
  1015.                    other buttons.
  1016.  
  1017.  
  1018. 5.2.2.3  Borland Check Box Style dialog box
  1019. -------------------------------------------
  1020.  
  1021. This dialog box lists two check box styles:
  1022.  
  1023. Auto check box     BWCC and Windows combine to handle checking
  1024.                    the selected box. This is the default option.
  1025.  
  1026. Check box          The application must call the CheckRadioButton
  1027.                    function to send a BM_SETCHECK message to
  1028.                    check the selected box.
  1029.  
  1030.  
  1031. 5.2.2.4  Borland Shade Style dialog box
  1032. ---------------------------------------
  1033.  
  1034. You can use this dialog box to convert a vertical or horizontal
  1035. dip (described in section 5.2 of this file) to a vertical or
  1036. horizontal bump. Dips are primarily intended to act as separators
  1037. in the dialog box background; bumps are intended as separators in
  1038. gray shade boxes.
  1039.  
  1040. To convert a vertical dip to a vertical bump,
  1041.  
  1042. 1.  Use the Vertical Dip control to add the dip to your dialog
  1043.     box.
  1044.  
  1045. 2.  Locate and size the dip as you want it.
  1046.  
  1047. 3.  Double-click on the dip to display the Borland Shade Style
  1048.     dialog box.
  1049.  
  1050. 4.  Click the Vertical Bump radio button and then click OK.
  1051.  
  1052. To convert a horizontal dip to a horizontal bump, follow the same
  1053. series of steps using the Horizontal Dip tool and the Horizontal
  1054. Bump radio button.
  1055.  
  1056.  
  1057. 5.3      Customizing existing applications for BWCC
  1058. ---------------------------------------------------
  1059.  
  1060. Resource Workshop allows you to customize existing Windows
  1061. applications with Borland-style custom controls (3D buttons,
  1062. dialog boxes with the "chiseled steel" look, and so on). There
  1063. are two steps to this process:
  1064.  
  1065. 1.  Modify your WIN.INI file to load the Borland Windows Custom
  1066.     Control (BWCC) library each time you start Windows.
  1067.  
  1068. 2.  Edit the application in Resource Workshop to change user
  1069.     interface features like dialog boxes, menus, icons, and so
  1070.     on.
  1071.  
  1072. The next two sections describe these steps in greater detail.
  1073.  
  1074.  
  1075. 6        Loading BWCC to enable Borland custom controls
  1076. -------------------------------------------------------
  1077.  
  1078. The BWCC library, which provides support for Borland-style custom
  1079. controls, must be loaded before an application can use BWCC's
  1080. features.
  1081.  
  1082. Edit the WIN.INI file (located in the Windows main directory) so
  1083. that Windows loads the file LOADBWCC.EXE into memory at start up.
  1084. The installation program places LOADBWCC.EXE in the language
  1085. compiler directory (the default location is \BORLANDC\BIN) and
  1086. adds this directory to your PATH.
  1087.  
  1088. Add LOADBWCC.EXE to the beginning of the list of files that
  1089. appear after the "LOAD=" statement. For example, if the LOAD
  1090. statement in your WIN.INI file looks like this:
  1091.  
  1092.     LOAD=NWPOPUP.EXE
  1093.  
  1094. the statement must be changed to this:
  1095.  
  1096.     LOAD=loadbwcc.exe NWPOPUP.EXE
  1097.  
  1098. LOADBWCC.EXE must appear first in the statement, to ensure that
  1099. BWCC is loaded into memory before any modified applications are
  1100. executed.
  1101.  
  1102. If you edit WIN.INI from within Windows, you must exit and
  1103. restart Windows to actually load LOADBWCC.EXE.
  1104.  
  1105.  
  1106. 7        Sample exercise: Customizing an existing application
  1107. -------------------------------------------------------------
  1108.  
  1109. This section gives an overview of the steps typically involved in
  1110. modifying an existing application--in this case, the Windows
  1111. Program Manager.
  1112.  
  1113. Resource Workshop operates on projects, which are made up of one
  1114. or more resources. Because a Windows application contains a
  1115. collection of resources, you can open the application itself as a
  1116. project and then modify its resources.
  1117.  
  1118.  
  1119. 7.1      Backing up the application
  1120. -----------------------------------
  1121.  
  1122. You should always edit backup copies of an application. Only
  1123. replace the original when you're satisfied that the modified
  1124. version functions correctly.
  1125.  
  1126. To make a backup copy of PROGMAN.EXE (Program Manager),
  1127.  
  1128. 1.  In the Program Manager's Main window, double-click the DOS
  1129.     Prompt icon.
  1130.  
  1131. 2.  At the DOS command line, switch to the C:\WINDOWS directory.
  1132.  
  1133. 3.  Type "copy PROGMAN.EXE MYSHELL.EXE" and press the Enter key.
  1134.  
  1135. 4.  Return to Windows by typing "exit" and pressing the Enter
  1136.     key.
  1137.  
  1138.  
  1139. 7.2      Opening a project
  1140. --------------------------
  1141.  
  1142. To open the Program Manager as a project in Resource Workshop,
  1143.  
  1144. 1.  Choose File|Open Project to display the Open Project dialog
  1145.     box.
  1146.  
  1147. 2.  Display the list of types by pressing the button for the File
  1148.     Type drop-down list box. Select EXE Application from the
  1149.     list.
  1150.  
  1151. 3.  Use the Directories box to change to the directory containing
  1152.     MYSHELL.EXE.
  1153.  
  1154. 4.  Double-click on the file name in the Files list box to load
  1155.     MYSHELL.EXE as the project.
  1156.  
  1157.  
  1158. 7.3      Editing the application's controls
  1159. -------------------------------------------
  1160.  
  1161. Now that you've loaded the application into Resource Workshop,
  1162. you can use the Dialog editor, Menu editor, Accelerator editor,
  1163. String editor, or Paint editor to customize the application. The
  1164. editors are discussed in the Resource Workshop User's Guide.
  1165.  
  1166. In this exercise, you'll use the Dialog editor to convert one of
  1167. the dialog boxes in the Program Manager to use BWCC.
  1168.  
  1169. NOTE: When it appears in the body of a paragraph, text that you
  1170. enter from the keyboard is set off by quotation marks. Unless you
  1171. are explicitly told to do so, do NOT include the quotation marks
  1172. in the text you enter.
  1173.  
  1174.  
  1175. 7.3.1    Starting the Dialog editor
  1176. -----------------------------------
  1177.  
  1178. With MYSHELL.EXE loaded as the current project, you see the
  1179. Project window appear with "myshell.exe" as the title. This
  1180. window displays a list of the resources contained in the Program
  1181. Manager: a menu, several dialogs, a few string tables, an
  1182. accelerator table, and a number of icons. You can edit any one of
  1183. these resources by double-clicking it or by highlighting it and
  1184. choosing Resource|Edit.
  1185.  
  1186. Select dialog number 3 by locating the "Dialog" section of the
  1187. resource list and double-clicking "3". The dialog editor loads
  1188. the New Program Object dialog box (displayed when the user
  1189. chooses the Program Manager's File|New command).
  1190.  
  1191. When the Dialog editor appears, you can begin editing the dialog
  1192. box. The tasks you'll perform in this exercise include
  1193.  
  1194. - Changing the dialog box's class to the Borland style
  1195.  
  1196. - Changing the size of the dialog box
  1197.  
  1198. - Recessing and aligning the controls
  1199.  
  1200. - Changing the radio buttons to BWCC
  1201.  
  1202. - Replacing the buttons with BWCC buttons
  1203.  
  1204. - Aligning the buttons
  1205.  
  1206. - Saving and testing the edited dialog box
  1207.  
  1208.  
  1209. 7.3.2    Changing the dialog's class name
  1210. -----------------------------------------
  1211.  
  1212. To convert the New Program Object dialog box to a Borland-style
  1213. dialog box, you must first change its class name.
  1214.  
  1215. 1.  Double-click on the New Program Object dialog box's title bar
  1216.     to display the Window Style dialog box.
  1217.  
  1218. 2.  Press the Tab key to move the cursor to the Class text
  1219.     control.
  1220.  
  1221. 3.  Enter the following as the Class:
  1222.  
  1223.        BorDlg
  1224.  
  1225.     Click OK to exit the dialog box.
  1226.  
  1227. The New Program Object dialog box now has the BWCC
  1228. "chiseled-steel" background.
  1229.  
  1230.  
  1231. 7.3.3    Sizing and rearranging the dialog box
  1232. ----------------------------------------------
  1233.  
  1234. Now change the size and layout of the dialog box to make room for
  1235. the "group shade" and the BWCC buttons. (The group shade is a
  1236. recessed area you place behind the two radio buttons to give the
  1237. dialog box the appearance of depth.)
  1238.  
  1239. 1.  Select the dialog box by clicking on its title bar or edge.
  1240.     (If the dialog box is already selected, skip this step.)
  1241.  
  1242. 2.  Drag the bottom border down about two inches.
  1243.  
  1244. 3.  Deselect the dialog box frame by clicking anywhere in the
  1245.     empty Dialog editor workspace outside the dialog box itself.
  1246.     (Use this same technique whenever you are instructed to
  1247.     deselect something.)
  1248.  
  1249. 4.  Shift-click on each of the dialog box's buttons (OK, Cancel,
  1250.     and Help) to select them. Delete them by pressing the Del
  1251.     key. (The BWCC buttons are larger than standard Windows
  1252.     buttons. You will replace the buttons in a later set of
  1253.     steps.)
  1254.  
  1255. 5.  Select the "New" group and press the Del key to delete it.
  1256.     You will replace it shortly.
  1257.  
  1258. The gray background of the two radio buttons extends well past
  1259. the text strings. Make the background smaller by doing this:
  1260.  
  1261. 1.  Select the "Program Group" radio button.
  1262.  
  1263. 2.  Drag the right edge of its selection frame to the left, until
  1264.     it's close to the text.
  1265.  
  1266. 3.  Shift-click to select the other radio button. Both should now
  1267.     be selected.
  1268.  
  1269. 4.  Choose Align|Size, and choose the Horizontal Size|Shrink to
  1270.     Smallest option from the Size Controls dialog box.
  1271.  
  1272. 5.  With both radio buttons still selected (and their gray
  1273.     backgrounds now the same size), click the Horizontal Center
  1274.     in Dialog tool (third from the left in the top row of
  1275.     alignment tools).
  1276.  
  1277. 6.  To make room for the new "New" text string, press the
  1278.     down-arrow key several times to move the radio buttons down
  1279.     in the dialog box. Press the Enter key when the radio buttons
  1280.     are where you want them.
  1281.  
  1282.  
  1283. 7.3.4    Adding the group shade
  1284. -------------------------------
  1285.  
  1286. To make the controls appear recessed, add the group shade.
  1287.  
  1288. 1.  Click the group shade tool (in the upper right corner of the
  1289.     Tools palette).
  1290.  
  1291. 2.  Move the crosshair cursor above and to the left of the radio
  1292.     buttons. Don't start so far above the radio buttons that
  1293.     there won't be room for the "New" text string. Click to place
  1294.     the group shade box.
  1295.  
  1296. 3.  Drag the lower right corner of the group shade box until it
  1297.     surrounds the radio buttons. Make it large enough that the
  1298.     radio buttons don't appear crowded inside.
  1299.  
  1300. 4.  Click the Horizontal Center in Dialog tool (third from the
  1301.     left in the top row of the Alignment tools) to center the
  1302.     group shade in the dialog box.
  1303.  
  1304.  
  1305. 7.3.5    Adding the text string
  1306. -------------------------------
  1307.  
  1308. To add the "New" text string above the group shade box,
  1309.  
  1310. 1.  Click the Text Static Tool (the large letter T in the third
  1311.     column from the left of the Tools Palette).
  1312.  
  1313. 2.  Move the crosshair to a point directly above the upper left
  1314.     corner of the group shade box. Click to place the static
  1315.     text.
  1316.  
  1317. 3.  Drag the right edge of the static text frame to the right
  1318.     until it is not quite as wide as the group shade box.
  1319.  
  1320. 4.  Double-click on the static text to display the Static Style
  1321.     dialog box.
  1322.  
  1323. 5.  Type " New" (with one leading blank space) as the Caption,
  1324.     and click OK to close the dialog box.
  1325.  
  1326. 6.  With the static text still selected, Shift-click to select
  1327.     the group shade box too.
  1328.  
  1329. 7.  Choose Align|Size and then Grow to Largest from the Size
  1330.     Controls dialog box.
  1331.  
  1332. 8.  Deselect everything by clicking in the empty work area
  1333.     outside the dialog box frame. Note how the static text
  1334.     appears to be slightly longer than the group shade because of
  1335.     the white edge on the right side of the group shade.
  1336.  
  1337. 9.  Click to select the static text.
  1338.  
  1339. 10. Drag its right edge one grid increment to the right. (You'll
  1340.     see the selection frame "snap" to the new position.)
  1341.  
  1342. 11. At this time, you can also drag the static text down closer
  1343.     to the group shade, if necessary, to leave just a single dark
  1344.     line between the static text and the group shade.
  1345.  
  1346.     Deselect the static text if you need to check its position.
  1347.  
  1348.  
  1349. 7.3.6    Converting the radio buttons
  1350. -------------------------------------
  1351.  
  1352. To convert the "Program Group" radio button to BWCC,
  1353.  
  1354. 1.  Hold down the Ctrl key as you double-click the radio button.
  1355.     The Generic Control Style dialog box is displayed.
  1356.  
  1357. 2.  Change the Class from "BUTTON" to "BorRadio" and then click
  1358.     OK. The quotes are required, but the text is not case
  1359.     sensitive.
  1360.  
  1361. Repeat these steps for the "Program Item" radio button.
  1362.  
  1363.  
  1364. 7.3.7    Adding a horizontal dip
  1365. --------------------------------
  1366.  
  1367. Borland dialog boxes use a horizontal dip (see section 5.2 of
  1368. this file) to separate the exit buttons (OK, Cancel, and others)
  1369. from the rest of the controls.  To add a horizontal dip
  1370.  
  1371. 1.  Click the Horizontal Dip tool (second from the top in the
  1372.     BWCC column in the Tools palette).
  1373.  
  1374. 2.  Click the crosshair at the left edge of the dialog box frame,
  1375.     about a quarter of an inch below the group shade box. Note
  1376.     that the horizontal dip does not extend the full width of the
  1377.     dialog box.
  1378.  
  1379. 3.  Choose Align|Size and then choose the Horizontal Size|Width
  1380.     of Dialog option.
  1381.  
  1382.  
  1383. 7.3.8    Replacing the buttons
  1384. ------------------------------
  1385.  
  1386. To replace the dialog box's buttons with BWCC buttons,
  1387.  
  1388. 1.  Select the BWCC Button tool (in the middle of the fourth
  1389.     column of the Tools palette).
  1390.  
  1391. 2.  Locate the crosshair at the point where you want the upper
  1392.     left corner of the first button (the OK button), and click.
  1393.     At this point, all the new buttons will simply say "Button".
  1394.  
  1395.     If the dialog box is not large enough for the new buttons,
  1396.     drag the bottom border to make more room.
  1397.  
  1398. 3.  Move the mouse to the right, locate the pointer arrow at the
  1399.     point where you want the upper left corner of the second
  1400.     button (Cancel), and click the RIGHT mouse button. By doing
  1401.     so, you duplicate the most recently added control (in this
  1402.     case, the first button).
  1403.  
  1404. 4.  Repeat step 3 to place the third button (Help). When you are
  1405.     done, you should have a horizontal row of three buttons.
  1406.     Don't worry about how neat the row is.
  1407.  
  1408. To convert the first button to a BWCC OK button with the green
  1409. check mark,
  1410.  
  1411. 1.  Double-click on the left button to display the Borland Button
  1412.     Style dialog box.
  1413.  
  1414. 2.  Type the following (in all uppercase letters) as the Control
  1415.     ID:
  1416.  
  1417.        IDOK
  1418.  
  1419.     You can also enter 1 as the Control ID.
  1420.  
  1421. 3.  Select Defpushbutton as the Button Type to make OK the
  1422.     default push button.
  1423.  
  1424. 4.  Click the Group check box in the Attributes. (The button
  1425.     should now be set to both Tab Stop and Group.)
  1426.  
  1427. 5.  Click OK to change the button to the Borland-style OK button.
  1428.  
  1429. To convert the second button to a BWCC Cancel button with the red
  1430. X,
  1431.  
  1432. 1.  Double-click on the second button to display the Borland
  1433.     Button Style dialog box.
  1434.  
  1435.     Type the following (in all uppercase letters) as the Control
  1436.     ID:
  1437.  
  1438.        IDCANCEL
  1439.  
  1440.     You can also enter 2 as the Control ID.
  1441.  
  1442. 2.  Click the Group check box in the Attributes. (The button
  1443.     should now be set to both Tab Stop and Group.)
  1444.  
  1445. 3.  Click OK to change the button to the Borland-style Cancel
  1446.     button.
  1447.  
  1448. To modify the last button for Help,
  1449.  
  1450. 1.  Double-click on the last button to display the Borland Button
  1451.     Style dialog box.
  1452.  
  1453.     Type the following as the Caption:
  1454.  
  1455.        &Help
  1456.  
  1457.     (The ampersand puts an underscore under the "H," so the user
  1458.     can get Help by pressing the Alt-H key combination.)
  1459.  
  1460. 2.  Tab to Control ID and enter "126". (This was the button's
  1461.     original control ID and is required for the user to be able
  1462.     to access Help successfully.)
  1463.  
  1464. 3.  Click the Group check box in the Attributes. (The button
  1465.     should now be set to both Tab Stop and Group.)
  1466.  
  1467. 4.  Click OK to exit the dialog box.
  1468.  
  1469. To align the buttons relative to each other and to center them in
  1470. the dialog box, first select them by dragging a selection frame.
  1471. Make sure nothing else is selected. Then use the Align menu
  1472. commands or the Alignment tools.
  1473.  
  1474. To use the Align menu commands,
  1475.  
  1476. 1.  Choose Align|Align to display the Align Controls dialog box.
  1477.     Choose the Vertical Alignment|Centers option and click OK.
  1478.     This command aligns the buttons in a single row.
  1479.  
  1480. 2.  Choose Align|Array to display the Form Control Into an Array
  1481.     dialog box. Set Rows to 1, Columns to 3, and Order to "Left
  1482.     to right." Click OK. This command spaces the buttons evenly
  1483.     relative to each other.
  1484.  
  1485. 3.  If there is too much space at the bottom of the dialog box,
  1486.     now is the time to drag the buttons up nearer to the gray
  1487.     shade and to drag the bottom edge of the dialog box up.
  1488.  
  1489. 4.  Choose Align|Align again. Choose the Horizontal
  1490.     Alignment|Center In Dialog option and click OK. This command
  1491.     centers the buttons horizontally in the dialog box.
  1492.  
  1493. To use the Alignment tools,
  1494.  
  1495. 1.  Click the Vertical Alignment|Centers tool, the vertical
  1496.     double-headed arrow without line segments (second from the
  1497.     left, bottom row). This tool aligns the buttons in a single
  1498.     row.
  1499.  
  1500. 2.  Click the Duplicate tool (in the left column of the Tools
  1501.     palette, second from the bottom). In the Form Control Into an
  1502.     Array dialog box, set Rows to 1, Columns to 3, and Order to
  1503.     "Left to right." Click OK. This tool spaces the buttons
  1504.     evenly relative to each other.
  1505.  
  1506. 3.  If there is too much space at the bottom of the dialog box,
  1507.     now is the time to drag the buttons up nearer to the gray
  1508.     shade and to drag the bottom edge of the dialog box up.
  1509.  
  1510. 4.  Click the Horizontal Alignment|Center in Dialog tool, the
  1511.     horizontal double-headed arrow with line segments at each end
  1512.     (third from the left, top row). This tool centers the buttons
  1513.     horizontally in the dialog box.
  1514.  
  1515.  
  1516. 7.4      Saving and testing the project
  1517. ---------------------------------------
  1518.  
  1519. You have now completed your modifications to the Program
  1520. Manager's New Program Object dialog box. To save your work,
  1521. choose File|Save Project.
  1522.  
  1523. To test the modified dialog box in Resource Workshop, choose
  1524. Options|Test Dialog or click the Test tool.
  1525.  
  1526. You can also run MYSHELL.EXE from Windows to see how the new
  1527. dialog box looks under the Program Manager. Choose File|Run, and
  1528. set the command line to "C:\WINDOWS\MYSHELL.EXE" (or give the
  1529. path to your Windows directory, if it is not on drive C). In this
  1530. case, you are actually running a second "copy" of the Program
  1531. Manager. When you are finished, choose File|Exit Windows to
  1532. return to your initial "copy" of the Program Manager.
  1533.  
  1534.  
  1535. 8        Tips on editing resources
  1536. ----------------------------------
  1537.  
  1538. This section discusses considerations to keep in mind when
  1539. editing resources of existing applications.
  1540.  
  1541.  
  1542. 8.1      Accelerators
  1543. ---------------------
  1544.  
  1545. If you add an accelerator, make sure it returns the same ID value
  1546. as its corresponding menu command. If you don't, the accelerator
  1547. will either execute the wrong command or do nothing.
  1548.  
  1549.  
  1550. 8.2      Bitmaps
  1551. ----------------
  1552.  
  1553. You may modify existing bitmaps in an application, but you may
  1554. not delete them.
  1555.  
  1556. Do not add new bitmaps. In most cases, the application will not
  1557. be able to use them.
  1558.  
  1559.  
  1560. 8.3      Cursors
  1561. ----------------
  1562.  
  1563. You may modify existing cursors in an application, but you may
  1564. not delete them.
  1565.  
  1566. Do not add new cursors. In most cases, the application will not
  1567. be able to use them.
  1568.  
  1569.  
  1570. 8.4      Dialog boxes
  1571. ---------------------
  1572.  
  1573. You can reposition items in a dialog box and convert controls to
  1574. their Borland custom control counterparts.
  1575.  
  1576. As you edit, be sure not to change the type of control associated
  1577. with each control ID value. For example, if control ID 100 is a
  1578. check box, don't change it to a radio button. The application
  1579. will still treat it as a check box.
  1580.  
  1581. In most cases you can remove controls that are not directly tied
  1582. to the application's functionality. For example, you can usually
  1583. remove a caption, a static text item that has no effect on how
  1584. the application works; but you can't remove an edit control,
  1585. which does affect how the application works.
  1586.  
  1587. Never add new controls. The application will not be able to use
  1588. them.
  1589.  
  1590.  
  1591. 8.5      Icons
  1592. --------------
  1593.  
  1594. You may modify existing icons in an application, but you may not
  1595. delete them.
  1596.  
  1597. Do not add new icons. In most cases, the application will not be
  1598. able to use them.
  1599.  
  1600.  
  1601. 8.6      Menus
  1602. --------------
  1603.  
  1604. With most applications, you can safely move commands within a
  1605. menu. Don't, however, move commands from one menu to another.
  1606. (For example, don't move the Open command from the File menu to
  1607. the Edit menu.) If you do, the application might be unable to
  1608. display context-sensitive Help or to check or uncheck the menu
  1609. commands.
  1610.  
  1611. Never change the order of the menus in the menu bar. For example,
  1612. if File is the first menu, don't make it the second.
  1613.  
  1614.  
  1615. 8.7      String tables
  1616. ----------------------
  1617.  
  1618. Use caution when editing existing string tables. Some programs
  1619. load the strings into buffers of fixed size, and adding text to
  1620. an existing string could overflow the buffer.
  1621.  
  1622. Never add new strings. The application will not be able to use
  1623. them.
  1624.